﻿using System;

namespace X.Config
{
    /// <summary>
    /// 基本设置描述类, 加[Serializable]标记为可序列化
    /// </summary>
    [Serializable]
    public class GeneralConfigInfo : IConfigInfo
    {
        #region 私有字段

        private int m_validatecodelength;   //验证码长度
        private int m_validatecodeimagewidth;   //验证码图片宽度
        private int m_validatecodeimageheight;  //验证码图片高度

        private int m_validatecodefontsize;
        private bool m_validatecodedir;     //是否扭曲
        private double m_validatecodemultvalue;     //波形的幅度倍数，越大扭曲的程度越高，一般为3
        private double m_validatecodephase;     //波形的起始相位，取值区间[0-2*PI)  PI = 3.1415926535897932384626433832795

        private string m_ipdenyaccess = ""; //IP禁止访问列表
        private string m_verifyimageassemly = "";//验证码生成所使用的程序集
        private int _defaultpagesize;
        private int _defaultpagesingroup;

        private int _defaultshortnoticequantity;

        private bool _isglobal;
        private string _defaultpwd;

        #endregion

        #region 属性

        public int ValidateCodeLength
        {
            set { m_validatecodelength = value; }
            get { return m_validatecodelength; }
        }

        public int ValidateCodeImageWidth
        {
            set { m_validatecodeimagewidth = value; }
            get { return m_validatecodeimagewidth; }
        }

        public int ValidateCodeImageHeight
        {
            set { m_validatecodeimageheight = value; }
            get { return m_validatecodeimageheight; }
        }

        public int ValidateCodeFontSize
        {
            get { return m_validatecodefontsize; }
            set { m_validatecodefontsize = value; }
        }

        public bool ValidateCodeDir
        {
            get { return m_validatecodedir; }
            set { m_validatecodedir = value; }
        }

        public double ValidateCodeMultValue
        {
            get { return m_validatecodemultvalue; }
            set { m_validatecodemultvalue = value; }
        }

        public double ValidateCodePhase
        {
            get { return m_validatecodephase; }
            set { m_validatecodephase = value; }
        }

        /// <summary>
        /// IP禁止访问列表
        /// </summary>
        public string Ipdenyaccess
        {
            get { return m_ipdenyaccess; }
            set { m_ipdenyaccess = value; }
        }

        /// <summary>
        /// 验证码生成所使用的程序集
        /// </summary>
        public string VerifyImageAssemly
        {
            get { return m_verifyimageassemly; }
            set { m_verifyimageassemly = value; }
        }

        /// <summary>
        /// 默认每页显示记录数
        /// </summary>
        public int DefaultPageSize
        {
            get { return _defaultpagesize; }
            set { _defaultpagesize = value; }
        }

        /// <summary>
        /// 默认每次显示页数
        /// </summary>
        public int DefaultPagesInGroup
        {
            set { _defaultpagesingroup = value; }
            get { return _defaultpagesingroup; }
        }

        public int DefaultShortNoticeQuantity
        {
            set { _defaultshortnoticequantity = value; }
            get { return _defaultshortnoticequantity; }
        }

        /// <summary>
        /// 是否为全球
        /// </summary>
        public bool IsGlobal
        {
            set { _isglobal = value; }
            get { return _isglobal; }
        }

        public string DefaultPwd
        {
            get { return _defaultpwd; }
            set { _defaultpwd = value; }
        }

        public int FileUpLoadMaxLength { get; set; }
        public int VideoFileMaxLength { get; set; }

        #endregion
    }
}
